<?php
/**
 * CLAROLINE
 *
 * Ajax actions for the Portfolio tool in Claroline
 *
 * @author Pierre Raynaud <pierre.raynaud@u-clermont1.fr>
 *
 * @package PORTFOL
 *
 */
/**
 *  CLAROLINE MAIN SETTINGS
 */

require '../../claroline/inc/claro_init_global.inc.php';
require_once 'lib/portfolio.lib.php';
require_once 'lib/classes/modele.class.php';
require_once 'lib/classes/grille.class.php';
require_once 'lib/classes/elementGrille.class.php';
require_once 'lib/classes/saisie.class.php';

$modele = new Modele();

$grille = new Grille();

$element = new ElementGrille();

$saisie = new Saisie();


// Gestion requete AJAX
if ($_POST['fonction'])
{
	foreach ($_POST as $key=>$param)
	{
		$_POST[$key] = utf8_decode($param);
	}
	
	$feedback = $_POST['fonction']();
	
	if (is_array($feedback))
	{
		print_r($feedback);
	}
	else
	echo utf8_decode($feedback);
	
	exit;
}
?>